package com.hmall.feignconfig;

import com.hmall.common.dto.Address;
import com.hmall.common.dto.Item;
import com.hmall.common.dto.PageDTO;
import com.hmall.common.dto.inventory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("itemservice")
public interface itemClient {


    /**
     * 分页查询
     * @param page
     * @param size
     * @return
     */
    @GetMapping("/item/list")
    public PageDTO<Item> list(@RequestParam("page") Integer page,@RequestParam("size") Integer size);


    /**
     * 根据ID查询
     * @param id
     * @return
     */
    @GetMapping("/item/{id}")
    public Item getById(@PathVariable Long id);


    /**
     * 减库存
     * @param itemId
     * @param num
     */
    @PutMapping("/item/stock/{itemId}/{num}")
    public void stock(@PathVariable("itemId") Long itemId,@PathVariable("num") Integer num);
}
